<div class="wrapper-md" ng-controller="goodsInformation">
    <toaster-container toaster-options="{'position-class': 'toast-top-center', 'close-button':true}"></toaster-container>
    <div ng-if="warehouseList" class="panel panel-default">
        <div class="panel-heading">
            {{title.title}}
            <!--<button style="float: right;margin-top: -5px;margin-left: 15px;" class="btn m-b-xs btn-sm btn-info btn-addon">-->
            <!--<i class="fa fa-trash-o"></i>删除-->
            <!--</button>-->
            <button ng-click="goodsinformationJump()"  style="float: right;margin-top: -5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>新建
            </button>
        </div>
        <div class="hbox hbox-auto-xs hbox-auto-sm">
            <div class="col" style="width:20%">
                <div class="wrapper-md">
                    <div class="b-a bg-light dk r r-2x">
                        <span ng-if="doing_async">...loading...</span>
                        <div style="width:100%;height:462px;overflow-y:scroll;overflow-x:auto;" class="zTreeDemoBackground left">
                            <ul id="mytree" class="ztree"></ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel-body b-b b-light">
                搜索: <input id="filter" type="text" class="form-control input-sm w-sm inline m-r"/>
            </div>
            <div>
                <table class="table m-b-none" ui-jq="footable" data-filter="#filter" data-page-size="10">
                    <thead>
                    <tr>
                        <th>{{columns[0].title}}</th>
                        <th>{{columns[1].title}}</th>
                        <th>{{columns[2].title}}</th>
                        <th>{{columns[3].title}}</th>
                        <th>{{columns[4].title}}</th>
                        <th>{{columns[5].title}}</th>
                        <th>{{columns[6].title}}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="tb in saveDate">
                        <td><a href ng-click="showInfo(tb)"><u>{{tb.goodsinformationNumber}}</u></a></td>
                        <td>{{tb.goodsinformationHpmc}}</td>
                        <td>{{tb.goodsinformationHpxh}}</td>
                        <td>{{tb.goodsinformationHplb}}</td>
                        <!--<td>{{tb.hpdj}}</td>-->
                        <td>{{tb.goodsinformationZmkc}}<a ng-click="showChangeInfo(tb)" style="float: right;cursor: pointer;" data-toggle="tooltip" title="点击查看库存变动详情"><u><i style="color: red;" class="icon-eye"></i>详情</u></a></td>
                        <!--<td>{{tb.sjkc}}</td>-->
                        <td>{{tb.createTime}}</td>
                        <td data-value="1"><span class="{{tb.status1}}">{{tb.status}}</span></td>
                    </tr>
                    </tbody>
                    <tfoot class="hide-if-no-paging">
                    <tr>
                        <td colspan="5" class="text-center">
                            <ul class="pagination"></ul>
                        </td>
                    </tr>
                    </tfoot>
                </table>


            </div>
        </div>

    </div>
    <div ng-if="warehouseAdd" class="panel panel-default">
        <div class="panel-heading">
            <u style="cursor:pointer"  ng-click="goodsinformationJump()">{{title.title}}</u> / {{title.addTitle}}
            <button ng-click="goodsinformationSave('sm')" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-primary btn-addon">
                <i class="fa fa-plus"></i>保存
            </button>
            <button ng-click="goodsinformationJump()" style="float: right;margin-top: -5px;margin-left: 5px;" class="btn m-b-xs btn-sm btn-default btn-addon">
                <i class="fa fa-hand-o-left"></i>返回
            </button>
        </div>
        <div class="panel-body">
            <h3 style="text-align: center"><b>货品资料信息表</b></h3>
            <form class="form-horizontal" method="get">
                <h7><b>基本信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>制&nbsp;&nbsp;单&nbsp;&nbsp;人</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" id="zdr" value="{{row.zdr}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>制单日期</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" ng-required="true" id="createTime" value="{{row.createTime}}"/>
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red">*</span>货品编码</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" id="goodsinformationNumber" value="{{row.goodsinformationNumber}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <h7><b>货品明细信息</b></h7>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>货品名称</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpmc" value="{{row.goodsinformationHpmc}}">
                    </div>

                    <label class="col-sm-1 control-label" for="input-id-1"><span style="color:red">*</span>货品型号</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpxh" value="{{row.goodsinformationHpxh}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-3"><span style="color:red">*</span>货品单位</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpdw" value="{{row.goodsinformationHpdw}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">

                    <label class="col-sm-1 control-label" for="input-id-4"><span style="color:red">*</span>货品类别</label>
                    <div class="col-sm-3">
                        <input readonly style="width:84%;float: left" type="text" class="form-control" id="goodsinformationHplb" value="{{row.goodsinformationHplb}}">
                        <input readonly style="display: none" type="text" class="form-control" id="goodsinformationHplbid" value="{{row.goodsinformationHplbid}}">
                        <span class="input-group-btn">
                            <button ng-click="showSelectGoodsType('goodsinformationHplb','goodsinformationHplbid')" class="btn btn-default" type="button"><i class="fa fa-plus"></i></button>
                        </span>
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red"></span>标准工时</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="hpdj" value="{{row.goodsinformationBzgs}}">
                    </div>
                    <label ng-if="app.power.powerPrice" class="col-sm-1 control-label" for="input-id-2"><span style="color:red"></span>单&nbsp;&nbsp;价&nbsp;&nbsp;一</label>
                    <div ng-if="app.power.powerPrice" class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpdj" value="{{row.goodsinformationHpdj}}">
                    </div>
                </div>
                <div ng-if="app.power.powerPrice" class="line line-dashed b-b line-lg pull-in"></div>
                <div ng-if="app.power.powerPrice" class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red"></span>单&nbsp;&nbsp;价&nbsp;&nbsp;二</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpdj1" value="{{row.goodsinformationHpdj1}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red"></span>单&nbsp;&nbsp;价&nbsp;&nbsp;三</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpdj2" value="{{row.goodsinformationHpdj2}}">
                    </div>
                    <label class="col-sm-1 control-label" for="input-id-2"><span style="color:red"></span>单&nbsp;&nbsp;价&nbsp;&nbsp;四</label>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" id="goodsinformationHpdj3" value="{{row.goodsinformationHpdj3}}">
                    </div>
                </div>
                <div ng-if="showKuCun" class="line line-dashed b-b line-lg pull-in"></div>
                <div ng-if="showKuCun" class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存</label>
                    <div class="col-sm-3">
                        <input readonly type="text" class="form-control" id="goodsinformationZmkc" value="{{row.goodsinformationZmkc}}">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</label>
                    <div class="col-sm-11">
                        <textarea type="text" class="form-control" id="goodsinformationBz" value="{{row.goodsinformationBz}}">{{row.goodsinformationBz}}</textarea>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">上传附件</label>
                    <div class="col-sm-4">
                        <!--onchange='angular.element(this).scope().upFile(this)'-->
                        <input id="uploadFile"  ng-src={{files[0].name}} id="file" ui-jq="filestyle" type="file" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control inline v-middle input-s">
                    </div>
                    <button type="button" class="btn btn-primary update-button" style="" ng-click="upFile()">
                        添加
                    </button>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div ng-if="showFiles.length!==0" class="hbox hbox-auto-xs hbox-auto-sm"  >
                    <div class="col">
                        <div class="wrapper-md">
                            <table class="table bg-white-only b-a">
                                <thead>
                                <tr>
                                    <th width="50%">文件名称</th>
                                    <th>大小</th>
                                    <th>进度</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="item in showFiles">
                                    <td><strong>{{ item.myFileRealName }}</strong></td>
                                    <td nowrap>{{ item.myFileSize/1024/1024|number:2 }} MB</td>
                                    <td>
                                        <div class="progress progress-sm m-b-none m-t-xs">
                                            <div class="progress-bar bg-info" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                        </div>
                                    </td>
                                    <td class="text-center">
                                        <span ng-show="item.isSuccess" class="text-success"><i class="glyphicon glyphicon-ok"></i></span>
                                        <!--<span ng-show="item.isCancel" class="text-warning"><i class="glyphicon glyphicon-ban-circle"></i></span>-->
                                        <span ng-show="item.isError" class="text-danger"><i class="glyphicon glyphicon-remove"></i></span>
                                    </td>
                                    <td nowrap>
                                        <button type="button" class="btn btn-default btn-xs" ng-click="doupFile($index)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
                                            上传
                                        </button>
                                        <button type="button" class="btn btn-default btn-xs" ng-click="" ng-disabled="!item.isCancel">
                                            <a download="" title="下载文件" href = '/a_yongan/upload/{{item.myFileType}}/{{item.myFileDocNumber}}/{{item.myFileName}}'>下载</a>
                                        </button>
                                        <button type="button" class="btn btn-default btn-xs" ng-click="deleteFile($index)">
                                            移除
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div ng-if="showFiles.length!==0" class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="input-id-1">是否启用</label>
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox" ng-checked="{{row.qy}}" id="qy">
                        <i></i>
                    </label>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
            </form>
        </div>
    </div>
</div>
<script type="text/ng-template" id="myModalContent.html">
    <div ng-include="'tpl/modal.html'"></div>
</script>
<script type="text/ng-template" id="selectDept.html">
    <div ng-include="'tpl/selectDept.html'"></div>
</script>
<script type="text/ng-template" id="showGoodsChangeInfo.html">
    <div ng-include="'tpl/showGoodsChangeInfo.html'"></div>
</script>
<script type="text/ng-template" id="selectGoods.html">
    <div ng-include="'tpl/selectGoods.html'"></div>
</script>